var user = new Vue({
	el : 'search-btn',
	data:{
		currentPageNo:1,
		pageCount:0,
		sumRows:0,
		recordSet:[],
		pageNumbers:[]
	},
    methods : {
		search : function() {
			this.currentPageNo=1;
			$.ajax({
				url : '/demo/em/user/getUserList?pageNo='+this.currentPageNo,
				type : "POST",
				async : false,
				success : function(result) {
					this.resetRecordSet(result.dataList);
					this.totalPages=result.pageCount;
					this.totalRows=result.sumRows;
					this.resetPageNumbers();
				},
				error : function(result) {
					alert("系统异常");
				}
			});
		},//search
		resetPageNumbers:function(){
			this.pageNumbers=[];
			 var begin=Math.round(Math.max(1,self.currentPageIndex()-7/2));
		     var end=Math.round(Math.min(begin+(7-1),self.totalPages()));
			 for(var i=begin;i<=end;i++){
				 this.pageNumbers.push(i);// 重新写入页码数组
			 }
		},
		//有没有更简单的方法，比如整体赋值
		resetRecordSet:function(dataList){
			for(var i=0;i<dataList.length;i++){
				this.recordSet.push(dataList[i]);
			}
		}
	}//methods area
});

  var app = new Vue({
      el: '#app',
      data:{
    	currentPageNo: 1,
    	pageCount: 10,
        msg: ''
      },
      components:{
        'vue-nav': Vnav
      },
      methods:{
        callback : function(data) {
          this.currentPageNo = data
          this.msg = '你点击了'+data+ '页'
        }
      }//callback
  })